local size = 1
local w,h = 504*size,120*size
local icon = [[ui\引导头-1.tga]]
local ui = class.panel.create([[ui\新手引导.tga]],(1920 - w)/2,800 - h,w,h)
ui:hide()
ui.art = ui:add_panel(icon,20,(h-70)/2,70,70)
ui.title = ui:add_text('卡牌羁绊',100,25,w-110,20,14,4)
ui.title:set_color(0xffff9900)
ui.tip = ui:add_text('消耗木头按(G)键抽取卡牌，抽取的卡牌直接吞噬',100,55,w-120,80,12,7)
local esc = ui:add_button('',w-100,-25,100,30)
local esc_text = class.text:builder {
    parent = esc,
    text = '退下吧！',
    shadow_offset_x = 1,
    shadow_offset_y = -1,
    shadow_color = 0xff000000,
    --color = 0xffffff00,
    outline = true,
    font_size = 14,
    align = 5,
}


function esc:on_button_mouse_enter()
    esc_text:set_color(0xff00ff00)
end

function esc:on_button_mouse_leave()
    esc_text:set_color(0xffffffff)
end

function ui:on_button_clicked(button)
    if button==esc then
        ui:hide()
    end
end

ac.game:event '引导-显示内容'(function(_,player,title,tip,art)
    if player:is_self() then
        if title==nil then
            ui:hide()
            return
        end
        ui.art:set_normal_image(art or icon)
        ui.title:set_text(title)
        ui.tip:set_text(tip)
        ui:show()
    end
end)